package a2012c2.t6.chat.common;

import java.io.Serializable;
import java.util.Vector;

/**
 * The Class Mensaje.
 */
public class Mensaje implements Serializable {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 1L;

	/** The type. */
	private MessageType type;

	/** The nick. */
	private String nick;

	/** The text. */
	private String text;

	/** The users. */
	private Vector<String> users;

	/**
	 * Instantiates a new mensaje.
	 */
	public Mensaje() {
		users = new Vector<String>();
	}

	/**
	 * Gets the nick.
	 * 
	 * @return the nick
	 */
	public String getNick() {
		return nick;
	}

	/**
	 * Sets the nick.
	 * 
	 * @param nick
	 *            the new nick
	 */
	public void setNick(String nick) {
		this.nick = nick;
	}

	/**
	 * Gets the text.
	 * 
	 * @return the text
	 */
	public String getText() {
		return text;
	}

	/**
	 * Sets the text.
	 * 
	 * @param text
	 *            the new text
	 */
	public void setText(String text) {
		this.text = text;
	}

	/**
	 * Gets the type.
	 * 
	 * @return the type
	 */
	public MessageType getType() {
		return type;
	}

	/**
	 * Sets the type.
	 * 
	 * @param type
	 *            the new type
	 */
	public void setType(MessageType type) {
		this.type = type;
	}

	/**
	 * Gets the users.
	 * 
	 * @return the users
	 */
	public Vector<String> getUsers() {
		return users;
	}

	/**
	 * @param users
	 */
	public void setUsers(Vector<String> users) {
		this.users = users;

	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Mensaje [type=" + type + ", nick=" + nick + ", text=" + text + ", users=" + users + "]";
	}

	/**
	 * Enums
	 * 
	 * @author dwajser
	 * 
	 */
	@SuppressWarnings("javadoc")
	public enum MessageType {
		LOGIN, LOGOUT, LIST, ERROR, MESSAGE;
	}

}
